package com.xyz.cinema.service;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.xyz.cinema.entity.Movie;
import com.xyz.cinema.mapper.MovieMapper;

@Service
public class MovieService {
	
	@Resource
	MovieMapper movieMapper;

	public List<Movie> selectByName(String name){
		List<Movie> list = null;
		list = movieMapper.selectByName(name);
		return list;
	}
	
	public List<Movie> selectAll(){
		List<Movie> list = null;
		list = movieMapper.selectAll();
		return list;
	}
	
	public Movie selectById(int id){
		Movie movie = null;
		movie = movieMapper.selectById(id);
		return movie;
	}
	
	public int deleteMovie(int id){
		return movieMapper.deleteMovie(id);
	}
	
	public int updateMovie(Movie movie){
		return movieMapper.updateMovie(movie);
	}
	
	public int insertMovie(Movie movie){
		return movieMapper.insertMovie(movie);
	}
	
}
